package com.ruoyi.user.controller.app;


import com.ruoyi.common.core.constant.constant.PathConstant;
import com.ruoyi.common.core.context.SecurityContextHolder;
import com.ruoyi.common.core.pojo.vo.BaseVO;
import com.ruoyi.common.core.result.Result;
import com.ruoyi.user.service.IAnchorApplyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "App-主持相关", description = "App-主持相关")
@RestController
@RequestMapping(PathConstant.APP_PATH + "anchor-apply")
public class AppAnchorApplyController {

    private final IAnchorApplyService iAnchorApplyService;

    public AppAnchorApplyController(IAnchorApplyService iAnchorApplyService) {
        this.iAnchorApplyService = iAnchorApplyService;
    }

    @Operation(summary = "申请主持", description = "申请主持")
    @GetMapping
    public BaseVO apply() {
        Long userId = SecurityContextHolder.getUserId();
        iAnchorApplyService.apply(userId);
        return Result.success();
    }


}

